package kisti.gui.Demo;

import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

import kisti.gui.CDF.CAF_CE03Mon;

public class Demo_Notification extends JPanel{

	private JLabel lNotification;
	private JPanel pNotification;
	private JButton bNoti_Email, bNoti_SMS;
	
	private RequestDataToTierServerForDemo requestToserver;
	
	public Demo_Notification() {		
		
		pNotification = new JPanel();
		requestToserver = new RequestDataToTierServerForDemo();
				
		
		
		
		lNotification = new JLabel("Notification Demo");
		lNotification.setBounds(200,30, 150, 20);		
				
		bNoti_Email= new JButton("Send Email");
		bNoti_Email.setBounds(100, 100, 100, 20);
		
		bNoti_SMS= new JButton("Send SMS");
		bNoti_SMS.setBounds(300, 100, 100, 20);
		
		bNoti_Email.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				// TODO Auto-generated method stub
				System.out.println("send Email");
				requestToserver.request("DEMO_Email");
				
				
			}
		});
		bNoti_SMS.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub				
				System.out.println("send SMS");
				requestToserver.request("DEMO_SMS");
			}
		});
		
		
		
		this.setLayout(null);		
		this.setSize(100, 100);
		this.setBackground(Color.white);
		
		this.add(lNotification);
		this.add(bNoti_Email);
		this.add(bNoti_SMS);
	}

	
	/**
	 * Desc :
	 * @Method Name : main
	 * @param args
	 * 
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
				
		JFrame f = new JFrame();
		Demo_Notification dn = new Demo_Notification();
		
		
		f.add(dn);
		f.setSize(1024,700 );
		f.setVisible(true);
		f.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				System.exit(0);
			}

			public void windowDeiconified(WindowEvent e) {
				System.out.println("windowDeiconified");
			}

			public void windowIconified(WindowEvent e) {
				System.out.println("windowIconified");
			}
		});

	}

}
